<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src='https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js'></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/marked/1.2.7/marked.min.js"></script>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    #app{
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        overflow: auto;
        padding: 10px;
        box-sizing: border-box;
    }
    #app textarea{
        width: 50%;
        height: 100%;
        background-image: url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fi2.hdslb.com%2Fbfs%2Farchive%2Fbd3d78bb7827eb1c15b60cde6745b61a6f0d84a1.jpg&refer=http%3A%2F%2Fi2.hdslb.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1675265411&t=851f2250b5508f509a87e8b93f99ebf7);
        background-size: cover;
        box-sizing: border-box;
        padding: 10px;
    }
    #app div{
        width: 50%;
        height: 100%;
        box-sizing: border-box;
        padding: 10px;
        background-color: rgba(255, 105, 180,.5);
        color: #fff;
        font: 20px/30px "楷体";
        /* border: 1px solid; */
    }
</style>
<body>
    <div id="app">
        <textarea v-model="val"></textarea>
        <div v-html="mark"></div>
    </div>
</body>
</html>
<script>
    let vm = new Vue({
        el : "#app",
        data:{
            val : "# 输入内容..."
        },
        computed:{
             mark(){
                return marked(this.val)
             }
        }
    })
</script>